public class TestStatic {
    int id;
    String name;
    String pwd;
    static String company = "北京";

    public TestStatic(int id, String name){
        this.id = id;
        this.name = name;
    }

    public void login(){
        System.out.println(name);
    }

    public static void printCompany(){
        //login();    //静态方法中调用非静态成员，会报错
        System.out.println(company);
    }

    public static void main(String[] args){
        TestStatic u = new TestStatic(101,"老高");
        TestStatic.printCompany();
        TestStatic.company = "广东";
        TestStatic.printCompany();
    }
}
